<template>
  <div class="recommend">
      <div>
          <div class="header">
          <div class="header-title">入驻歌手</div>
          <div class="more" @click="$router.push('singer/signed')">更多></div>
      </div>
      <div class="body">
          <ul class="body-ul">
              <li v-for="v in hotList_detail" :key="v.id">
                  <div class="div_img" :title="`${v.name}的音乐`" @click="$router.push(`/singerMus/${v.id}`)">
                      <a href="javascript:;" class="a_img" >
                          <img :src="v.picUrl" alt="">
                      </a>
                  </div>
                  <div class="div_name">
                      <span class="singer_name" :title="`${v.name}的音乐`" @click="$router.push(`/singerMus/${v.id}`)">{{v.name }}</span>
                      <i class="el-icon-user-solid" :title="`${v.name}的个人主页`" @click="$router.push(`/geren/${v.id}`)" v-show="v.accountId"></i>
                  </div>
              </li>
          </ul>
      </div>
      </div>
      <div>
          <div class="header">
          <div class="header-title">热门歌手</div>
      </div>
      <div class="body">
          <ul class="body-ul hot">
              <li v-for="item in hotList_detail" :key="item.id">
                  <div class="div_img" :title="`${item.name}的音乐`" @click="$router.push(`/singerMus/${item.id}`)">
                          <img :src="item.picUrl" alt="">
                  </div>
                  <div class="div_name">
                      <span class="singer_name" @click="$router.push(`/singerMus/${item.id}`)" :title="`${item.name}的音乐`">{{ item.name }}</span>
                      <i class="el-icon-user-solid" :title="`${item.name}的个人主页`" v-show="item.accountId" @click="$router.push(`/geren/${item.id}`)"></i>
                  </div>
              </li>
              <li class="sml line" v-for="item in hotList_simple" :key="item.id">
                  <span :title="`${item.name}的音乐`" @click="$router.push(`/singerMus/${item.id}`)">{{ item.name }}</span>
                  <i class="el-icon-user-solid" :title="`${item.name}的个人主页`" v-show="item.accountId" @click="$router.push(`/geren/${item.id}`)"></i>
              </li>
          </ul>
      </div>
      </div>
  </div>
</template>

<script>
import { getHotList } from '@/api/singers'
export default {
  components: {

  },
  data () {
    return {
      hotList_detail: '',
      hotList_simple: ''
    //   isShowGeren: true
    }
  },
  created () {
    this.getHotListD()
    this.getHotListS()
  },
  methods: {
    async getHotListD () {
      const { data } = await getHotList({ limit: 10 })
      console.log(data)
      this.hotList_detail = data.artists
    },
    async getHotListS () {
      const { data } = await getHotList({ limit: 80, offset: 10 })
      console.log(data)
      this.hotList_simple = data.artists
    }
  }
}
</script>

<style lang="less" scoped>
.recommend {
    .header {
         height: 40px;
          padding: 0;
          border-bottom: 2px solid #c20c0c;
          .header-title {
              float: left;
              font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
            font-size: 24px;
            font-weight: normal;
          }
          .more {
            float: right;
            padding-top: 10px;
            &:hover {
            cursor: pointer;
            color: #c20c0c;
            text-decoration: underline;
            }
          }
    }
    .body {
        position: relative;
        width: 100%;
        padding-top: 20px;
        ul {
            // display: flex;
            width: 720px;
            height: 368px;
            list-style:none;
            li {
                float: left;
                width: 130px;
                height: 184px;margin-right: 17px;
                span:hover {
                    cursor: pointer;
                    text-decoration: underline;
                }
                &:nth-child(5n) {
                    margin: 0;
                }
                .div_img {
                        width: 100%;
                        height: 130px;
                        &:hover {
                            cursor: pointer;
                        }
                        img {
                            width: 100%;
                            height: 130px;
                            background-color: #fff;
                    }
                }
                .div_name {
                    width: 130px;
                    padding-top: 8px;
                    .singer_name {
                        float: left;
                        font-size: 12px;
                    }
                    .el-icon-user-solid {
                        float: right;
                        color: #c20c0c;
                        &:hover {
                            cursor: pointer;
                        }
                    }
                }
            }
            .hahaha {
                margin-bottom: 12px!important;
            }
            .sml {
                height: 30px;
                width: 144px;
                margin-right: 0;
                // border-top: 1px dotted #999;
                span {
                    font-size: 12px;
                }
                .el-icon-user-solid {
                margin-left: 5px;
                color: #c20c0c;
                &:hover {
                     cursor: pointer;
                }
            }
            }
        }
        .hot {
            height: 920px;
            &::after {
                display: block;
                content: ' ';
                position: relative;
                top: 356px;
                left: 0;
                height: 1px;
                width: 720px;
                border-bottom: 1px dotted #999;
            }
        }
    }
}
</style>
